/**
 * Created by liyang on 2017/10/27.
 */
import React,{Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    Button,
    FlatList
} from 'react-native';

import ServeList from './serve_list';
import Sudoku from './sudoku'

//用户信息
class UserView extends React.Component {
    constructor(props) {
        super(props);
    }
    // style={{flex: 1, flexDirection: 'row'}}
    render() {
        return (
            <View style={[style.userView, {flexDirection: 'row'}]}>
                <Image
                    style={[style.icon, {flex: 2}]}
                    source={require('./../image/chat.png')}
                />
                <View style={{flex: 5, backgroundColor: '#62681c'}}>
                    <Text style={{left: 30,top: 30}}>
                        {'J_763127186'}
                    </Text>
                    <Text style={{left: 30,top: 30}}>
                        {'积分'}
                    </Text>
                </View>
                <View style={{flex: 2}}>
                    <Text>
                        {'PLUS'}
                    </Text>
                </View>
            </View>
        )
    }
}

export default class Setting extends React.Component {
    static navigationOptions={
        headerTitle: '个人中心',
        headerRight:(
            <View>
                <Button
                    title="设置"
                    onPress={() => alert("hello")}
                />
            </View>
        ),
    };
    constructor(props) {
        super(props);


        const sudokuData = [];
        for (var i = 0; i < 10; i++) {

        }






    }
    render() {
        const {navigate} = this.props.navigation;
        console.log('render stting')
        return (
            <View>
                <View>
                    <UserView>
                    </UserView>
                </View>
                <View>
                    <ServeList
                    />
                </View>
                <View>
                    <Sudoku

                    />
                </View>
            </View>
        )
    }
}

const style = StyleSheet.create({
    userView: {
        height: 150,
        backgroundColor: 'red',
    },
    icon: {
        height:50,
        width: 50,
        resizeMode: 'contain',
        backgroundColor: 'transparent'
    }
});